from xml.etree.ElementTree import *
from PyFlac.Carbon import CarbonUtils
from PyFlac.Carbon import CarbonJob
from PyFlac.Carbon import CarbonSocketLayer
from PyFlac import TimeCode
import sys

SMB_PATH = 'c:\\'
GUID     = '{58E98FF9-9EF8-459E-AF2E-C7D07DD712F0}'

def test(source):

	carbon = CarbonSocketLayer.CarbonSocketLayer("10.221.173.31")

	jobXml = CarbonUtils.CreateCarbonXMLJob("unused", "unused", [], [{'d_guid': GUID, 'd_basename': "test", 'd_path': SMB_PATH}], s)	
	print jobXml

	job = CarbonJob.CarbonJob(carbon, jobXml)
	job.Start()

lst = []
lst.append({'type': "VIDEO", 'srctrack': 0, 'dsttrack' : 0, 'filename': "\\\\10.221.173.231\\Avid\\wc_1.mxf"})
lst.append({'type': "AUDIO", 'srctrack': 0, 'dsttrack' : 1, 'filename': "\\\\10.221.173.231\\Avid\\wc_1.wav"})
lst.append({'type': "AUDIO", 'srctrack': 0, 'dsttrack' : 2, 'filename': "\\\\10.221.173.231\\Avid\\wc_1.wav"})
lst.append({'type': "AUDIO", 'srctrack': 0, 'dsttrack' : 3, 'filename': "\\\\10.221.173.231\\Avid\\wc_1.wav"})
lst.append({'type': "AUDIO", 'srctrack': 0, 'dsttrack' : 4, 'filename': "\\\\10.221.173.231\\Avid\\wc_1.wav"})
lst.append({'type': "AUDIO", 'srctrack': 0, 'dsttrack' : 5, 'filename': "\\\\10.221.173.231\\Avid\\wc_1.wav"})
lst.append({'type': "AUDIO", 'srctrack': 0, 'dsttrack' : 6, 'filename': "\\\\10.221.173.231\\Avid\\wc_1.wav"})
lst.append({'type': "AUDIO", 'srctrack': 0, 'dsttrack' : 7, 'filename': "\\\\10.221.173.231\\Avid\\wc_1.wav"})
s = CarbonUtils.ComplexSourceGetSource(lst)

test(s)
